import axios from "@/utils/request.js";
export const getNewList = (category) => {
  return axios({
    url: '/post',
    params: category
  });
}
export const getDetail = (id) => {
  return axios({
    url: "/post/" + id
  });
}

//点赞文章
export const postLike = (id) => {
  return axios({
    url: '/post_like/' + id
  });
}
//收藏文章
export const postStar = (id) => {
  return axios({
    url: '/post_star/' + id
  });
}

//单个评论
export const postComment = (id) => {
  return axios({
    url: '/post_comment/' + id
  });
}

//发表评论
export const sendComment = (id, data) => {
  return axios({
    method: 'post',
    url: '/post_comment/' + id,
    data
  });
}

//搜索文章
export const searchArticle = (params) => {
  return axios({
    url: "/post_search",
    params
  });
}